﻿using System;
using System.ServiceModel;
using Sinacor.Infra.Common.Exceptions;
using Sinacor.Infra.Service.ExceptionHandling;
using System.ComponentModel;
using Sinacor.Infra.Service.Security.Services;
using System.Collections.Generic;
using Sinacor.Infra.Common.Validation;

namespace Sinacor.Servico.Bovespa.Cliente.Service.ServiceContract
{
    /// <summary>
    /// Interface de Cliente
    /// </summary>
    [ExceptionShielding]
    [ServiceContract(Namespace = "http://www.bovespa.com.br/Sinacor.Servico.Bovespa.Cliente.Service.ServiceContract", SessionMode = SessionMode.Allowed, Name="ICliente")]
	public interface ICliente
    {
        #region Métodos
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "ConsultarInformacoesCliente")]
        Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.ClienteResponse ConsultarInformacoesCliente(Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Request.ConsultarInformacaoClienteRequest request);

        /// <summary>
        /// Historico:
        /// Data : 30/11/2007
        /// Autor: Ludmilla Modesto 
        /// Obs.: Alterada a resposta para List
        /// </summary>
        /// <returns></returns>
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "ConsultarCliente")]
        List<Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.ClienteResponse> ConsultarCliente(Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Request.ConsultarClienteRequest request);

        /// <summary>
        /// Historico:
        /// Data : 04/12/2007
        /// Autor: Ludmilla Modesto 
        /// Obs.: Criado. Sera chamado pela tela de Financeiro
        /// </summary>
        /// <returns></returns>
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "ConsultarClienteFinanceiro")]
        List<Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.ClienteResponse> ConsultarClienteFinanceiro(Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Request.ConsultarClienteRequest request);

        /// <summary>
        /// Historico:
        /// Data : 04/12/2007
        /// Autor: Ludmilla Modesto 
        /// Obs.: Criado. Serviço que retornara se o cliente possui bloqueio ou não.
        /// </summary>
        /// <returns></returns>
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "VerificarBloqueioCliente")]
        Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.VerificarBloqueioClienteResponse VerificarBloqueioCliente(Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Request.VerificarBloqueioClienteRequest request);


		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "ConsultarClienteApelido")]
        Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.ClienteResponse ConsultarClienteApelido(Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Request.ConsultarClienteApelidoRequest filtroPorApelido);

        /// <summary>
        /// Historico:
        /// Data : 14/12/2007
        /// Autor: Ludmilla Modesto 
        /// Obs.: Criado. Retorna lista de emissores de ordens relacionados a um Cliente
        /// </summary>
        /// <returns></returns>
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "ConsultarEmissorOrdem")]
        List<Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.EmissorOrdemResponse> ConsultarEmissorOrdem(DataContract.Request.ConsultarEmissorOrdemRequest request);


        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "ConsultarCorrespondente")]
        DataContract.Response.CorrespondenteResponse ConsultarCorrespondente(DataContract.Request.ConsultarCorrespondenteRequest request);

        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "ValidarFilhote")]
        void ValidarFilhote(Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Request.ValidarFilhoteRequest request);


        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "ValidarClienteFilhote")]
        bool ValidarClienteFilhote(Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Request.ValidarClienteFilhoteRequest pValidarClienteFilhote);

        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "ValidarClienteBroker")]
        bool ValidarClienteBroker(Service.DataContract.Request.ConsultarClientePorCodigoRequest pValidarClienteBroker);

        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "ValidarCliente")]
        Sinacor.Infra.Common.Validation.ValidationResult  ValidarCliente(Service.DataContract.Request.ValidarClienteRequest pValidarCliente);

        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "ConsultarUsuarioInstitucional")]
        Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.UsuarioInstitucionalResponse ConsultarUsuarioInstitucional(Service.DataContract.Request.ConsultarClientePorCodigoRequest pConsultarUsuarioInstitucional);

        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "ConsultarAgenteCustodia")]
        Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.AgenteCustodiaResponse ConsultarAgenteCustodia(Service.DataContract.Request.ConsultarClientePorCodigoRequest pConsultarAgenteCustodia);


        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "ValidarDigitoVerifClienteInstitucional")]
        Sinacor.Infra.Common.Validation.ValidationResult ValidarDigitoVerifClienteInstitucional(Service.DataContract.Request.ValidarDigitoVerifClienteInstitucionalRequest pDigitoVerifClienteInstitucional);



        //Task : 5617
        //Data : 10/03/2009
        //Autor: APsilva
        /// <summary>
        /// Consultar e retornar o cliente associado ao fitro
        /// </summary>
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "ConsultarPorApelido")]
        Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.ClienteResponse ConsultarPorApelido(Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Request.FiltroClientePorApelidoRequest request);

        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "ObterCliente")]
        [OperationLog]
        DataContract.Response.ClienteResponse ObterCliente(DataContract.Request.FiltroClienteRequest filtroCliente );

        /// <summary>
        /// Valida a Existencia do Cliente
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [OperationLog]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "ValidarExistenciaCliente")]
        DataContract.Response.ResultadoValidacaoClienteResponse ValidarExistenciaCliente(DataContract.Request.FiltroCodigoClienteRequest request);

        #endregion
    }
}
